/*
 * Copyright 2002-2007 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.jteam.jsa.core;

/**
 * A search result returning as a result of a search operation.
 *
 * @author Uri Boness
 */
public interface SearchResult {

    /**
     * Returns the time (in milli-seconds) it took to perform the search.
     *
     * @return The time (in milli-seconds) it took to perform the search.
     */
    long getSearchTime();

    /**
     * Returns requested page of the search hits. This method returns a page as in case of a search, it makes no sense to not work with
     * pagination - there can be hundreds to millions possible hits (depending on the data set size) and it is very hard
     * to impossible to predict the total hit count. Therefore these API forces the use of pagination data.
     *
     * @return The requested page of the search hits.
     */
    ListPage<Hit> getHits();

}
